package com.lxh.student.service;

import com.lxh.student.entity.Student;
import com.lxh.student.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

@Service
@Transactional
public class StudentService {
    @Autowired
    private StudentMapper studentMapper;


    public List<Student> findAll() {
        return studentMapper.findAll();
    }
    public Student findById(Long id) {
        return studentMapper.findById(id);
    }
    public void insert(Student student) {
        studentMapper.insert(student);
    }
    public void update(Student student){
        studentMapper.update(student);
    }
    public void delete(Long id){
        studentMapper.delete(id);
    }

    public Student getById(Long id) {
        return studentMapper.findById(id);
    }
}

